<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Changes the color value of any pixel that matches target</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="imagick.flipimage.html">Imagick::flipImage</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="imagick.flopimage.html">Imagick::flopImage</a></div>
 <div class="up"><a href="class.imagick.html">Imagick</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="imagick.floodfillpaintimage" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Imagick::floodFillPaintImage</h1>
  <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">Imagick::floodFillPaintImage</span> &mdash; <span class="dc-title">Changes the color value of any pixel that matches target</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-imagick.floodfillpaintimage-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>Imagick::floodFillPaintImage</strong></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$fill</code></span>
   , <span class="methodparam"><span class="type">float</span> <code class="parameter">$fuzz</code></span>
   , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$target</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$x</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$y</code></span>
   , <span class="methodparam"><span class="type">bool</span> <code class="parameter">$invert</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$channel</code><span class="initializer"> = Imagick::CHANNEL_DEFAULT</span></span>
  ] )</div>


  <p class="para rdfs-comment">
   Changes the color value of any pixel that matches target and is an
   immediate neighbor. This method is a replacement for deprecated 
   <span class="function"><a href="imagick.paintfloodfillimage.html" class="function">Imagick::paintFloodFillImage()</a></span>.
   此方法在Imagick基于ImageMagick 6.3.8以上版本编译时可用。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-imagick.floodfillpaintimage-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">fill</code></em></dt>

     <dd>

      <p class="para">
       ImagickPixel object or a string containing the fill color
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">fuzz</code></em></dt>

     <dd>

      <p class="para">
       The amount of fuzz. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">target</code></em></dt>

     <dd>

      <p class="para">
       ImagickPixel object or a string containing the target color to paint
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">x</code></em></dt>

     <dd>

      <p class="para">
       X start position of the floodfill
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">y</code></em></dt>

     <dd>

      <p class="para">
       Y start position of the floodfill
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">invert</code></em></dt>

     <dd>

      <p class="para">
       If <strong><code>TRUE</code></strong> paints any pixel that does not match the target color.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">channel</code></em></dt>

     <dd>

      <p class="para">
       Provide any channel constant that is valid for your channel mode. To apply to more than one channel, combine <a href="imagick.constants.html#imagick.constants.channel" class="link">channel constants</a> using bitwise operators. 缺省为<strong><code>Imagick::CHANNEL_DEFAULT</code></strong>. 
参考此 <a href="imagick.constants.html#imagick.constants.channel" class="link">通道常数</a>列表
      </p>
     </dd>

    
   </dl>

  </p>

 </div>

 <div class="refsect1 returnvalues" id="refsect1-imagick.floodfillpaintimage-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-imagick.floodfillpaintimage-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3230">
    <p><strong>Example #1 <span class="methodname"><strong>Imagick::floodfillPaintImage()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">/*&nbsp;Create&nbsp;new&nbsp;imagick&nbsp;object&nbsp;*/<br /></span><span style="color: #0000BB">$im&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Imagick</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">/*&nbsp;create&nbsp;red,&nbsp;green&nbsp;and&nbsp;blue&nbsp;images&nbsp;*/<br /></span><span style="color: #0000BB">$im</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">newImage</span><span style="color: #007700">(</span><span style="color: #0000BB">100</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"red"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$im</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">newImage</span><span style="color: #007700">(</span><span style="color: #0000BB">100</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"green"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$im</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">newImage</span><span style="color: #007700">(</span><span style="color: #0000BB">100</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"blue"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;Append&nbsp;the&nbsp;images&nbsp;into&nbsp;one&nbsp;*/<br /></span><span style="color: #0000BB">$im</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">resetIterator</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$combined&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$im</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">appendImages</span><span style="color: #007700">(</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;Save&nbsp;the&nbsp;intermediate&nbsp;image&nbsp;for&nbsp;comparison&nbsp;*/<br /></span><span style="color: #0000BB">$combined</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">writeImage</span><span style="color: #007700">(</span><span style="color: #DD0000">"floodfillpaint_intermediate.png"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;The&nbsp;target&nbsp;pixel&nbsp;to&nbsp;paint&nbsp;*/<br /></span><span style="color: #0000BB">$x&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$y&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">/*&nbsp;Get&nbsp;the&nbsp;color&nbsp;we&nbsp;are&nbsp;painting&nbsp;*/<br /></span><span style="color: #0000BB">$target&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$combined</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getImagePixelColor</span><span style="color: #007700">(</span><span style="color: #0000BB">$x</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$y</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;Paints&nbsp;pixel&nbsp;in&nbsp;position&nbsp;1,1&nbsp;black&nbsp;and&nbsp;all&nbsp;neighboring&nbsp;<br />&nbsp;&nbsp;&nbsp;pixels&nbsp;that&nbsp;match&nbsp;the&nbsp;target&nbsp;color&nbsp;*/<br /></span><span style="color: #0000BB">$combined</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">floodfillPaintImage</span><span style="color: #007700">(</span><span style="color: #DD0000">"black"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$target</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$x</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$y</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;Save&nbsp;the&nbsp;result&nbsp;*/<br /></span><span style="color: #0000BB">$combined</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">writeImage</span><span style="color: #007700">(</span><span style="color: #DD0000">"floodfillpaint_result.png"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程的输出类似于：</p></div>
    <div class="mediaobject">
     
     <div class="imageobject">
      <img src="images/c0d23d2d6769e53e24a1b3136c064577-floodfillpaint_intermediate.png" alt="Output of example : Imagick::floodfillPaintImage()" width="100" height="150" />
     </div>
     <div class="imageobject">
      <img src="images/c0d23d2d6769e53e24a1b3136c064577-floodfillpaint_result.png" alt="Output of example : Imagick::floodfillPaintImage()" width="100" height="150" />
     </div>
    </div>
   </div>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="imagick.flipimage.html">Imagick::flipImage</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="imagick.flopimage.html">Imagick::flopImage</a></div>
 <div class="up"><a href="class.imagick.html">Imagick</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
